package main

import (
	utils "gitee.com/290198252/go-utils"
	"github.com/gin-gonic/gin/json"
	"log"
	"time"
)
func main()  {
	rsp,e :=  utils.HttpGet("http://104.199.245.218:9200/test/_mapping/doc",time.Second)
	if nil != e{
		log.Print(e.Error())
	}
	log.Print(string(rsp))
	body,_ := json.Marshal(`{
	"first_name": "bily",
		"last_name": "jean",
		"age": 29,
		"about": "I am a bitch",
		"interests": [
		"bw",
		"shit"
	]}`)
	rsp,e = utils.HttpPut("http://104.199.245.218:9200/test/","application/json; charset=utf-8",body,time.Second*10)
	if nil != e{
		log.Print(e.Error())
	}
	log.Print(string(rsp))
}